From ad62b7f19884b981adb62f338e01d1bf9ba98781 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 7 Apr 1993 18:34:17 +0000 Subject: [PATCH] (compilation-filter): New function. (compile-internal): Make it the process's filter. --- lisp/progmodes/compile.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ec2ef2b7266..ab942de603d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -321,6 +321,7 @@ Returns the compilation buffer created." outbuf command))) (set-process-sentinel proc 'compilation-sentinel) + (set-process-filter proc 'compilation-filter) (setq compilation-in-progress (cons proc compilation-in-progress)))) ;; Make it so the next C-x ` will use this buffer. (setq compilation-last-buffer outbuf))) @@ -404,6 +405,17 @@ Runs `compilation-mode-hook' with `run-hooks' (which see)." (setq compilation-in-progress (delq proc compilation-in-progress)) )))) +(defun compilation-filter (proc string) + "Process filter for compilation buffers. +Just inserts the text, but uses insert-before-markers." + (save-excursion + (set-buffer (process-buffer proc)) + (let ((buffer-read-only nil)) + (save-excursion + (goto-char (process-mark proc)) + (insert-before-markers string) + (set-marker (process-mark proc) (point)))))) + ;; Return the cdr of compilation-old-error-list for the error containing point. (defun compile-error-at-point () (compile-reinitialize-errors nil (point)) -- 2.30.2